package com.xiaoxie.boot.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @author xiaoxie
 * @create 2022-11-03 11:44
 */
@Data
@HeadStyle(fillPatternType = FillPatternTypeEnum.NO_FILL)
public class BookExcelExportVo {

    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ExcelProperty(value = {"图书信息", "图书名称"}, index = 0)
    private String bookName;

    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ExcelProperty(value = {"图书信息", "图书作者"}, index = 1)
    private String author;

    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ExcelProperty(value = {"图书信息", "出版社"}, index = 2)
    private String press;

    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ExcelProperty(value = {"图书信息", "书籍简介"}, index = 3)
    private String bookDescription;

    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ExcelProperty(value = {"图书信息", "书籍语言"}, index = 4)
    private String bookLanguage;

    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ExcelProperty(value = {"图书信息", "书籍价格"}, index = 5)
    private Double bookPrice;

    @DateTimeFormat(fallbackPatterns = "yyyy-MM-dd")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ExcelProperty(value = {"图书信息", "出版日期"}, index = 6)
    private String publicationTime;

    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ExcelProperty(value = {"图书信息", "书籍类型"}, index = 7)
    private String typeName;

}
